
<script src="http://cdn.bootcss.com/jquery/2.2.1/jquery.min.js"></script>
<script src="/public/js/ajax.js"></script>
<script src="//cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.js"></script>

<script>
  
  function exit(){
    var url ='/index.php/home/user/userexit';
    ajax('get',url,null,false);
    location.reload();
  }

</script>

<div id="header">
  <div class="head">
    <div class="top">
      <span>
        TP仿站--迅播影院
      </span>
      <p>
        <?php 
        if(!empty(cookie('user'))){
          echo '欢迎回来：',cookie('user');
          echo '&nbsp&nbsp&nbsp&nbsp<a href="javascript:void(0)" onclick="exit()">退出</a>';
        }else{
          echo '<a href="',U('home/user/reg'),'">注册</a> - ','<a href="',U('home/user/login'),'">登录</a>';
        } 
        ?> 
      </p>
    </div>
    <div class="logo">
      <a href="/index.php" title="首页">
        首页
      </a>
    </div>
    <p class="plus">
    
      <a href="<?php echo U('home/cat/search'); ?>" class="dq">
        影视大全
      </a>
    </p>
    <div id="search">

      <!-- 搜索 -->
      <div class="ser">
        <form name="formsearch" target="_top" id="formsearch" action='/index.php/home/cat/artsearch' method="post"
        target="_blank">
          <input type="text" id="kw" name="searchword" class="search-input" placeholder="请在此处输入影片片名或演员名称。"
          />
          <input type="submit" name="submit" class="sub" value="搜 索" />
        </form>
      </div>
      <!-- end -->

      <!-- 搜索下推荐影片 -->
<!--       <p>

        <?php  ?>
        <a href="/search.asp?searchword=%C9%B1%C6%C6%C0%C72">
          杀破狼2
        </a>
      </p> -->
      <!-- !end -->
    </div>

    <!-- 历史记录 -->
    <div class="history">
      <a href="#" class="gk">
        播放记录
      </a>
      <div class="drop-box">
        <div class="lookedlist">
          <p>
            <a class="closehis" href="javascript:;">
              关闭
            </a>
            <a href="javascript:void(0);" id="emptybt" onClick="javascript:setEmpty()">
              清空全部播放记录
            </a>
          </p>
          <ul class="highlight" id="playhistory">
          
          </ul>
        </div>
      </div>
    </div>
    </a>
    <script>
      var his = $.cookie('histroy');

      if (his != 'undefined') {

        var his = eval(his);
        inner = '';
        for (var i = 0; i < his.length; i++) {
          inner += '<li><a href="/index.php/sp/id/'+his[i]['art_id']+'">'+his[i]['title']+'</a></li>';
        }       
      }else{
        inner = '<li>没有播放记录</li>';
      }
      $('#playhistory').html(inner);
    </script>

    <!-- end历史记录 -->
    <!-- 栏目目录 -->
    <div id="menu">
      <div class="m">
        <p>
          <a href="/index.php"  class="menu">首页</a>
          <a href="<?php echo U('home/cat/movie'); ?>" class="menu">电影</a>
          <a href="<?php echo U('home/cat/tv'); ?>"  class="menu">电视剧</a>
          <a href="<?php echo U('home/cat/search/cat/3'); ?>"  class="menu">动画片</a>
          <a href="<?php echo U('home/cat/search/cat/4'); ?>"  class="menu">综艺片</a>
          <a href="<?php echo U('home/cat/search/cat/5'); ?>"  class="menu">影视预告</a>
        </p>

        <script>
        //控制导航背景色
        nav = $('#menu a');
        var type = "<?php echo $catname; ?>";
        for (var i = 0; i < nav.length; i++) {
          var a = nav[i];
          if (a.innerHTML == type) {
            $(a).css('backgroundColor','#0483b0');
          }; 
        };
        </script>

      </div>
    </div>
    <!-- end栏目 -->
  </div>
</div>